home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / geteblk.z / geteblk
Encoding:
Text File  |  1998-10-30  |  5.6 KB  |  132 lines

  1.  
  2.  
  3.  
  4. ggggeeeetttteeeebbbbllllkkkk((((DDDD3333))))                                                        ggggeeeetttteeeebbbbllllkkkk((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _gggg_eeee_tttt_eeee_bbbb_llll_kkkk - get an empty buffer
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_bbbb_uuuu_ffff_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  15.      _bbbb_uuuu_ffff______tttt _****_gggg_eeee_tttt_eeee_bbbb_llll_kkkk_((((_vvvv_oooo_iiii_dddd_))))_;;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      _gggg_eeee_tttt_eeee_bbbb_llll_kkkk retrieves a buffer [see _bbbb_uuuu_ffff(D4)] from the buffer cache and
  19.      returns a pointer to the buffer header.  If a buffer is not available,
  20.      _gggg_eeee_tttt_eeee_bbbb_llll_kkkk sleeps until one is available.
  21.  
  22.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  23.      A pointer to the buffer header structure is returned.
  24.  
  25. UUUUSSSSAAAAGGGGEEEE
  26.      When the driver _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy(D2) routine receives a buffer header from the
  27.      kernel, all the necessary members are already initialized.  However, when
  28.      a driver allocates buffers for its own use, it must set up some of the
  29.      members before calling its _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy routine.
  30.  
  31.      The following list describes the state of these members when the buffer
  32.      header is received from _gggg_eeee_tttt_eeee_bbbb_llll_kkkk:
  33.  
  34.           _bbbb______ffff_llll_aaaa_gggg_ssss       is set to indicate the transfer is from the user's
  35.                         buffer to the kernel.  The driver must set the _BBBB______RRRR_EEEE_AAAA_DDDD
  36.                         flag if the transfer is from the kernel to the user's
  37.                         buffer.
  38.  
  39.           _bbbb______eeee_dddd_eeee_vvvv        is set to _NNNN_OOOO_DDDD_EEEE_VVVV and must be initialized by the driver.
  40.  
  41.           _bbbb______bbbb_cccc_oooo_uuuu_nnnn_tttt      is set to 1024.
  42.  
  43.           _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr   is set to the buffer's virtual address.
  44.  
  45.           _bbbb______bbbb_llll_kkkk_nnnn_oooo       is not initialized by _gggg_eeee_tttt_eeee_bbbb_llll_kkkk, and must be initialized
  46.                         by the driver
  47.  
  48.      Typically, block drivers do not allocate buffers.  The buffer is
  49.      allocated by the kernel, and the associated buffer header is used as an
  50.      argument to the driver _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy routine.  However, to implement some
  51.      special features, such as _iiii_oooo_cccc_tttt_llll(D2) commands that perform I/O, the driver
  52.      may need its own buffer space.  The driver can get the buffer space from
  53.      the system by using _gggg_eeee_tttt_eeee_bbbb_llll_kkkk or _nnnn_gggg_eeee_tttt_eeee_bbbb_llll_kkkk(D3).  If the driver chooses to
  54.      use its own memory for the buffer, it can allocate a buffer header only
  55.      using _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff(D3).
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. ggggeeeetttteeeebbbbllllkkkk((((DDDD3333))))                                                        ggggeeeetttteeeebbbbllllkkkk((((DDDD3333))))
  69.  
  70.  
  71.  
  72.      Buffers allocated via _gggg_eeee_tttt_eeee_bbbb_llll_kkkk must be freed using either _bbbb_rrrr_eeee_llll_ssss_eeee(D3) or
  73.      _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee(D3).
  74.  
  75.    LLLLeeeevvvveeeellll
  76.      Base only.
  77.  
  78.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  79.      Can sleep.
  80.  
  81.      Driver-defined basic locks and read/write locks may not be held across
  82.      calls to this function.
  83.  
  84.      Driver-defined sleep locks may be held across calls to this function.
  85.  
  86. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  87.      _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee(D3), _bbbb_iiii_oooo_wwww_aaaa_iiii_tttt(D3), _bbbb_rrrr_eeee_llll_ssss_eeee(D3), _bbbb_uuuu_ffff(D4), _nnnn_gggg_eeee_tttt_eeee_bbbb_llll_kkkk(D3)
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.